package teste;

import org.nakedobjects.extended.Cardinality;
import org.nakedobjects.extended.Entity;
import org.nakedobjects.extended.RelationshipObject;
import org.nakedobjects.extended.Way;
import org.nakedobjects.object.AbstractNakedObject;
import org.nakedobjects.object.collection.ExtendedInternalCollection;

@Entity
public class A extends AbstractNakedObject{
	
	@RelationshipObject(cardinality=Cardinality.ManyToMany, 
			fieldRelatedName="abs1", 
			relatedWith=B.class, 
			way=Way.TwoWay, 
			compositeClass = AB1.class, 
			compositeFieldName = "a", 
			compositeFieldRelatedName = "b")
	private final ExtendedInternalCollection abs1 = new ExtendedInternalCollection(
			"Abs1", AB1.class, this);
	public ExtendedInternalCollection getAbs1() {
		return abs1;
	}
	
	@RelationshipObject(cardinality=Cardinality.ManyToMany, 
			fieldRelatedName="abs2", 
			relatedWith=B.class, 
			way=Way.TwoWay, 
			compositeClass = AB2.class, 
			compositeFieldName = "a", 
			compositeFieldRelatedName = "b")
	private final ExtendedInternalCollection abs2 = new ExtendedInternalCollection(
			"Abs2", AB2.class, this);
	public ExtendedInternalCollection getAbs2() {
		return abs2;
	}
	
}
